package com.example.demo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.entity.Test;
import com.example.demo.mapper.TestMapper;
import com.example.demo.service.ITestService;

@Service
public class TestServiceImpl implements ITestService {

	@Resource
	private TestMapper testMapper;

	@Override
	public int insertTest(Test test) {
		return testMapper.insertTest(test);
	}

	@Override
	public List<Test> getAll(Test test) {
		List<Test> list = testMapper.getAll(test);
		return list;
	}

	@Override
	public int update(Test test) {
		return testMapper.updateById(test);
	}

	@Override
	public Page<Test> getPage(Page<Test> page) {
		QueryWrapper<Test> qw = new QueryWrapper<>();
		Page<Test> res = testMapper.selectPage(page, qw);
		return res;
	}

}
